package com.bwie.controller;

import com.bwie.service.EventsService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/events/events")
public class EventsController {

    @Autowired
    EventsService eventsService;

    /**
     * 显示抽奖活动数据
     * @param pageInfoVo
     * @return
     */
    @PostMapping("/list")
    public R list (@RequestBody @Validated PageInfoVo pageInfoVo) {
        return eventsService.list(pageInfoVo);
    }
}
